﻿namespace Zo.Collections
{
    /// <summary>
    /// 分页参数。
    /// </summary>
    public class PagerParameters
    {
        /// <summary>
        /// 构造器。
        /// </summary>
        public PagerParameters()
            : this(1, 10)
        {
        }

        /// <summary>
        /// 初始化分页参数。
        /// </summary>
        /// <param name="index">页码。</param>
        /// <param name="size">页大小。</param>
        public PagerParameters(int index, int size)
        {
            if (index < 1)
            {
                index = 1;
            }

            if (size < 1)
            {
                size = 1;
            }

            Index = index;
            Size = size;
        }

        /// <summary>
        /// 页码
        /// </summary>
        public int Index { get; set; }

        /// <summary>
        /// 页大小
        /// </summary>
        public int Size { get; set; }
    }
}